﻿using System;
using Ranet.AgOlap.Core.MetadataDescription;

namespace Galaktika.BI.Silverlight.Controls.General.Tree
{
    public class DimensionTreeNode : CustomTreeNode
    {
        DimensionInfo m_Info = null;
        public DimensionInfo Info
        {
            get {
                return m_Info;
            }
        }

        public DimensionTreeNode(DimensionInfo info)
        {
            if (info == null)
                throw new ArgumentNullException("info");
            
            m_Info = info;
            Text = info.Caption;

            if (m_Info.DimensionType == DimensionInfoTypeEnum.Measure)
            {
                Icon = UriResources.Images.Measure16;
            }
            else
            {
                Icon = UriResources.Images.Dimension16;
            }
        }
    }
}
